<!DOCTYPE html>
<html>
<title>城通，让我看看！</title>

<head>
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
    <link rel="icon" href="https://user-images.githubusercontent.com/82699919/135619410-05a75925-162d-4dcf-9470-f49aaeb1e877.png" type="image/png" />
    <!-- MDUI CSS -->
    <link href="https://cdn.bootcdn.net/ajax/libs/mdui/1.0.2/css/mdui.min.css" rel="stylesheet">

    <!-- MDUI JavaScript -->
    <script src="https://cdn.bootcdn.net/ajax/libs/mdui/1.0.2/js/mdui.min.js"></script>
    <link rel="preconnect" href="https://fonts.proxy.ustclug.org">
    <link rel="preconnect" href="https://fonts-gstatic.proxy.ustclug.org" crossorigin>
    <link href="https://fonts.proxy.ustclug.org/css2?family=ZCOOL+KuaiLe&display=swap" rel="stylesheet">
</head>

<body class="mdui-theme-primary-teal">
  <div class="mdui-container">
    <br>
      <div class="mdui-card mdui-shadow-16" style="border-radius: 15px;">
        <div class="mdui-card-primary">
	  <p class="mdui-text-center" style="font-family: 'ZCOOL KuaiLe', cursive;"><font size="8"><span style="background-color:#0080FF"><font color="white">CT</font></span> 让我看看！</font></p>	
	  <h4 class="mdui-text-center" style="font-family: 'ZCOOL KuaiLe', cursive;"><font size="4">在 线 城 通 网 盘 直 链 解 析 神 器</font></h4>
        </div>
      </div>
      <br>
      <div class="mdui-card mdui-shadow-16" style="border-radius: 15px;">
        <div class="mdui-card-primary">
          <p class="mdui-text-center" style="font-family: 'ZCOOL KuaiLe', cursive;"><font size="6" color="#3844BA">请 输 入 链 接 和 密 码</font></p>
	  <p class="mdui-text-center" style="font-family: 'ZCOOL KuaiLe', cursive;"><font size="2" color="gray">下载地址只能用一次,不可用于分享</font></p>
	  <div class="mdui-textfield mdui-textfield-floating-label">
            <label class="mdui-textfield-label" id="my-label-id">城通网盘分享链接</label>
            <input class="mdui-textfield-input" id="link" aria-labelledby="my-label-id">
          </div>
          <br>
          <br>
	  <div class="mdui-textfield mdui-textfield-floating-label">
            <label class="mdui-textfield-label" id="my-label-id">城通网盘分享密码</label>
            <input class="mdui-textfield-input" id="passcode" aria-labelledby="my-label-id">
          </div>
          <br>
          <br>
	  <button class="mdui-btn mdui-color-theme mdui-ripple" onclick="getInfo();" style="border-radius: 10px;">
	    GET!
	  </button>
          <H4 id="filename"></H4>
	  <H4 id="filesize"></H4>
	  <H4 id="filetime"></H4>
          <p id="dlURL"></p>
	  <button class="mdui-btn mdui-color-theme mdui-ripple" onclick="dlFile();" style="border-radius: 10px; display:none;" id="dlbtn">
	    下载
	  </button>
        </div>
     </div>
     <br>
     <div class="mdui-card mdui-shadow-16" style="border-radius: 15px 15px 2px 2px;">
        <div class="mdui-card-primary">
	  <div class="mdui-row">
	    <div class="mdui-col-xs-6 mdui-hidden-sm-down">
		<p class="mdui-text-center" style="font-family: 'ZCOOL KuaiLe', cursive;"><font size="8"><span style="background-color:#0080FF"><font color="white">CT</font></span> 让我看看！</font></p>
		<p class="mdui-text-center" style="font-family: 'ZCOOL KuaiLe', cursive;"><font size="1" color="gray">你 受 够 了 城 通 的 龟 速 吗 ？ 快 使 用 “ 城 通 ， 让 我 看 看 ” ！</font></p>
		<p class="mdui-text-center" style="font-family: 'ZCOOL KuaiLe', cursive;"><a href="https://ctfiles.hydroion.work/" style="text-decoration:none;"><font size="1" color="gray">h t t p s : / / c t f i l e s . h y d r o i o n . w o r k /</font></a></p>
	    </div>
	    <div class="mdui-col-xs-2 mdui-hidden-sm-down">
		<ul class="mdui-list mdui-hidden-sm-down">
                  <li class="mdui-subheader">常用链接</li>
                  <a href="https://400gb.com/" class="mdui-list-item mdui-ripple">城通网盘</a>
	          <a href="http://www.lanjuhua.com/" class="mdui-list-item mdui-ripple">城通搜索</a>
	        </ul>
	    </div> 
	    <div class="mdui-col-xs-2 mdui-hidden-sm-down">
		<ul class="mdui-list mdui-hidden-sm-down">
                  <li class="mdui-subheader">感谢清单</li>
                  <a href="https://mdui.org/" class="mdui-list-item mdui-ripple">MDUI</a>
                  <a href="https://github.com/qinlili23333/ctfileGet" class="mdui-list-item mdui-ripple">ctfileGet</a>
	        </ul>
	    </div>
	    <div class="mdui-col-xs-2 mdui-hidden-sm-down">
		<ul class="mdui-list mdui-hidden-sm-down">
                  <li class="mdui-subheader">旗下服务</li>
                  <a href="dl.html" class="mdui-list-item mdui-ripple">离线版本</a>
                  <a href="iframehelp.html" class="mdui-list-item mdui-ripple">网页嵌入</a>
	        </ul>
	    </div>
	    <footer><font size="1" color="gray">2021 WStudio, Made by love. This project is for convenience only.</font></footer>
	  </div>
	</div>
     </div>
   </div>
 </div> 
    <script>
        var link;
        var fileid;
        var jsonurl;
        var passcodeArgu="";
        var jsonText;
        var jsonText2;
        var xhr;
        var dlURL;
        var getInfo = function () {
            link = document.getElementById("link").value;
            fileid = link.slice(link.indexOf("/f/") + 3);
            xhr = new XMLHttpRequest();
            xhr.onreadystatechange = function () {
                if (xhr.readyState == 4) {
                    jsonText = JSON.parse(xhr.responseText);
                    if(jsonText.code==200){
                    document.getElementById("filename").innerText = "名字: " + jsonText.file_name;
                    document.getElementById("filesize").innerText = "大小: " + jsonText.file_size;
                    document.getElementById("filetime").innerText = "时间: " + jsonText.file_time;
                    document.getElementById("dlURL").innerText = "正在扒衣服（雾）";
                    getURL();
                    }else{
                        document.getElementById("filename").innerText = "阿勒勒，城通不理我了啦，可能是你贴错了喔（？）";
                    }
                }
            };
            if (document.getElementById("passcode").value) {
                passcodeArgu = "&passcode=" + document.getElementById("passcode").value;
            }else{
                passcodeArgu = "&passcode=547873715"
            }
            jsonurl = "https://webapi.ctfile.com/getfile.php?path=f&f=" + fileid + passcodeArgu + "&token=false&r=" + Math.random() + "&ref=https://ctfile.qinlili.bid"
            xhr.open('get', jsonurl);
            //xhr.setRequestHeader('X-Referer', link);
            xhr.send(null);
        }
        var getURL = function () {
            jsonurl = "https://webapi.ctfile.com/get_file_url.php?uid=" + jsonText.userid + "&fid=" + jsonText.file_id + "&file_chk=" + jsonText.file_chk + "&app=0&acheck=2&rd=" + Math.random()
            xhr = new XMLHttpRequest();
            xhr.onreadystatechange = function () {
                if (xhr.readyState == 4) {
                    jsonText2 = JSON.parse(xhr.responseText);
                    dlURL = jsonText2.downurl;
                    document.getElementById("dlURL").innerText = "这是您的餐点: \n \n" + dlURL;
                    document.getElementById("dlbtn").style.display = "block";
                }
            };
            xhr.open('get', jsonurl);
            xhr.send(null);
        }
        var dlFile = function () {
            funDownload(dlURL, jsonText.file_name);
        }

    </script>
    <script>
        window.mdc.autoInit();
        mdc.ripple.MDCRipple.attachTo(document.querySelector('.foo-button1'));
        mdc.ripple.MDCRipple.attachTo(document.querySelector('.foo-button2'));
        var getRandomColor = function () {
            return '#' + (function (color) {
                return (color += 'abcdef'[Math.floor(Math.random() * 6)])
                    && (color.length == 6) ? color : arguments.callee(color);
            })('');
        }
        function strip(num, precision = 10) {
            return +parseFloat(num.toPrecision(precision));
        }
        function funDownload(content, filename) {

            var eleLink = document.createElement('a');
            eleLink.download = filename;
            eleLink.style.display = 'none';
            eleLink.href = content;
            document.body.appendChild(eleLink);
            eleLink.click();
            document.body.removeChild(eleLink);
        };
    </script>
</body>

</html>
